from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    #
    def find_ss(self):
        ele=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
        loc=self.find_ele(ele)
        return loc
    def find_ss2(self):
        ele=(By.CLASS_NAME,'android.widget.EditText')
        loc=self.find_ele(ele)
        return loc
    def find_dian(self):
        ele=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜索")')
        loc=self.find_ele(ele)
        return loc
    def dinaji(self):
        ele=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.xiachufang:id/common_photo_image_view"])[1]')
        loc=self.find_ele(ele)
        return loc
    def duanyan(self):
        ele=(By.ID,'com.xiachufang:id/recipe_name')
        loc=self.find_ele(ele)
        return loc
    #用例2
    # def find_ss(self):
    #     ele=(By.XPATH,'//android.widget.TextView[@text="搜索菜谱"]')
    #     loc=self.find_ele(ele)
    #     return loc
    # def find_ss2(self):
    #     ele=(By.CLASS_NAME,'android.widget.EditText')
    #     loc=self.find_ele(ele)
    #     return loc
    # def find_dian(self):
    #     ele=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜索")')
    #     loc=self.find_ele(ele)
    #     return loc
    # def find_zuo(self):
    #     ele=(By.XPATH,'//android.widget.TextView[@text="做过最多"]')
    #     loc=self.find_ele(ele)
    #     return loc
    # def find_aa(self):
    #     ele=(By.XPATH,'(//android.widget.LinearLayout[@resource-id="com.xiachufang:id/common_item_container"])[1]')
    #     loc=self.find_ele(ele)
    #     return loc
    # def duanyan(self):
    #     ele=(By.ID,'com.xiachufang:id/recipe_name')
    #     loc=self.find_ele(ele)
    #     return loc